<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
      属性独立，方法共享
     */
      function Person() {
        this.name = "jack"; //2
        this.age = 20; //2
        this.add = function () {}; //2
      }
      Person.prototype.money = 1000;
      Person.prototype.say = function () {}; //1

      const p1 = new Person();
      const p2 = new Person();
    </script>
  </body>
</html>
